<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="stylesheet_1.css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Home</title>
    </head>

    <body>

        <c:if test="${not empty error}">
            <div class="error"  style="color:#FF0000" align="center">
                Login failed. Try again.<br />
                ${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
            </div>
        </c:if>

    <body topmargin="200">
        <a href="<c:url value="/registration.html"/>">If you don't have an account please register</a>

        <h1>Authorization</h1>


        <form action="<c:url value="/j_spring_security_check" />" method='POST'>
            <table width="100%" border="0" cellspacing="0" cellpadding="4">
                <tr>
                    <td>Login:</td>
                    <td align = "right"> <input autofocus type="text" name='j_username'></td>
                </tr>
                <tr>
                    <td>Password:</td>
                    <td align = "right"><input type="password" name='j_password'></td>
                </tr>
                <tr>
                    <td/>
                    <td align = "right"><button>Sign in</button></td>
                </tr>
            </table>
        </form>
    </body>
</html>
